/**
 * Copyright 2025 Beijing Volcano Engine Technology Co., Ltd. All Rights Reserved.
 * SPDX-license-identifier: BSD-3-Clause
 */

import { IconRight } from '@arco-design/web-react/icon';
import utils from '@/utils/utils';
import Lasttime from '@/pages/ChooseAi/lasttime'
import { Link,useSearchParams,useNavigate } from 'react-router-dom';
interface IProps {
  title?: string;
  lastItem?:boolean;
  islatest?:number;
  id?:number
}
export default function Item(props: IProps) {
    const {
        title,
        lastItem,
        id
      } = props;
      const navigate = useNavigate();
    let hasChoose = props.islatest
    const toTrainPage=()=>{
        navigate(`/aiPractice?trainingid=${props?.id}`,{ replace: false })
     }
    return (
        <div onClick={()=>{toTrainPage()}} className={`rounded-[10px] h-[60px] border  flex justify-between items-center  ${lastItem?'mb-0':'mb-[10px]'} px-4 text-sm ${hasChoose===title?'border-[#FFBC0D] selectBg':'border-gray-200'}`}>
           <div className='flex items-center justify-between'><div style={{flex:1}}>{title}</div>{hasChoose===1?<Lasttime className="ml-2 "/>:''}</div>
           <IconRight />
        </div>
    );
}
